# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=dirstalk
pkgver=1.3.3
pkgrel=3
pkgdesc='Modern alternative to dirbuster/dirb.'
arch=('x86_64' 'aarch64')
groups=('blackarch' 'blackarch-scanner' 'blackarch-webapp')
url='https://github.com/stefanoj3/dirstalk'
license=('MIT')
makedepends=('git' 'go')
source=("https://github.com/stefanoj3/$pkgname/archive/$pkgver.tar.gz")
sha512sums=('282f6de56054b3d6a92af3af0d658623213af6233dda667ff59fa890d1ef09e229f192c6fb0a3ba7e73ae0617637c342d71a17c41f703c3b10a44393873ab4ea')

build() {
  cd $pkgname-$pkgver

  GOPATH="$srcdir" go mod download
  GOPATH="$srcdir" go build \
    -trimpath \
    -buildmode=pie \
    -mod=readonly \
    -modcacherw \
    -ldflags "-s -w" \
    -o $pkgname ./cmd/$pkgname
}

package() {
  cd "$pkgname-$pkgver"

  install -Dm 755 $pkgname "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

